<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <button @click="list.push(333)">添加数组元素</button>
        <button @click="list.pop()">删除数组元素</button>

        <!-- 不会被侦听到 -->
        <button @click="list[0] = 9999" >修改下标0的元素</button>

        <div>
            {{ list }}
        </div>
    </div>
    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                list: [10,20]
            },
            watch: {

                list () {
                    console.log('数组有改变')
                }
            }
        })
    </script>
</body>
</html>